<button type="button" class="btn btn-primary" (click)="staticModal.show()">Static modal</button>
 
<div class="modal fade" bsModal #staticModal="bs-modal" [config]="{backdrop: 'static'}"
     tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title pull-left">Static modal</h4>
        <button type="button" class="close pull-right" aria-label="Close" (click)="staticModal.hide()">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form  novalidate
    class="form-horizontal form-box">
    <div class="form-group">
      <label for="inputEmail3" class="col-sm-3 control-label">用户名:</label>
      <div class="col-sm-9">
        <input type="text" class="form-control" id="inputEmail3" placeholder="用户名" name="userName" #userName>
      </div>
    </div>
    <div class="form-group">
      <label for="inputPassword3" class="col-sm-3 control-label">密码：</label>
      <div class="col-sm-9">
        <input type="password" class="form-control" id="inputPassword3" placeholder="密码" name="pwd" #pwd>
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
        <div class="checkbox">
          <label>
            <input type="checkbox"> Remember me
          </label>
        </div>
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">

        <button type="submit" class="btn btn-default"
            (click)="onSubmit(userName, pwd)">
            <i class="glyphicon glyphicon-hand-right"
             ></i>登录
        </button>

      </div>
    </div>

  </form>
      </div>
    </div>
  </div>
</div>